<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>支付后抽奖</title>
    <link href="__STATIC_URL__/static/css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/js/qrcode/qrcode.js"></script>
    <style type="text/css">
        .viewWrap {
            background: rgba(0, 0, 0, .5);
            padding: 6px;
        }

        .aui_titleBar {
            position: relative;
            height: 100%;
        }

        .aui_state_focus .aui_title {
            color: #4c5a5f;
        }

        .aui_title {
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .aui_title {
            height: 28px;
            line-height: 27px;
            padding: 0 28px 0 10px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
            background-color: #edf5f8;
            font-weight: bold;
            color: #95a7ae;
            font-family: Tahoma, Arial/9 !important;
            background-color: #bdc6cd;
            background: linear-gradient(top, #edf5f8, #bdc6cd);
            background: -moz-linear-gradient(top, #edf5f8, #bdc6cd);
            background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#edf5f8), to(#bdc6cd));
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#edf5f8', endColorstr='#bdc6cd');
            border-top: 1px solid #edf5f8;
            border-bottom: 1px solid #b6bec5;
        }
        .glyphicon-asterisk {
            color: #e01a1a;
            font-family: "宋体";
            font-size: 18px;
            margin-right: 8px;
        }

        .control-label {
            font-weight: 400;
        }

        .ipt250 {
            width: 400px;
        }

        .input-group-addon {
            position: relative;
        }

        .input-group-addon, .input-group-btn {
            width: auto;
        }

        .input-group-addon a {
            display: inline-block;
        }

        a.upload {
            width: 72px;
            background-image: none !important;
            border: none !important;
            text-shadow: none !important;
            margin-left: 5px;
            padding: 3px 8px !important;
            cursor: pointer !important;
            display: inline-block !important;
            overflow: visible !important;
            border-radius: 2px !important;
            -moz-border-radius: 2px !important;
            -webkit-border-radius: 2px !important;
            background-color: #44b549 !important;
            color: #fff !important;
            font-size: 14px !important;
        }

        .upload:hover {
            background-color: #5ba607 !important;
            color: #fff !important;
            text-decoration: none;
            text-shadow: none;
        }

        .uploadFile {
            position: absolute;
            top: 5px;
            left: 10px;
            width: 50px;
            height: 20px;
            opacity: 0;
        }
    </style>
</head>

<body id="body">
{include file='public/header'/}
<section id="content">
    {include file='public/left'/}
    <div class="content">
        <!--路径导航-->
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>
                    <a href="javascript:void(0);">营销工具</a>
                </li>
                <li>
                    <a href="{:url('marke/tools')}">活动营销</a>
                </li>
                <li>
                    <a href="{:url('marke/paylottery')}">支付后抽奖</a>
                </li>
                <li>
                    <a href="javascript:void(0);" onClick="javascript :history.back(1);">九宫格活动</a>
                </li>
                <li class="active" style="color: #02b87f;">创建九宫格活动</li>
            </ul>
        </div>
        <!--创建会员卡主要内容-->
        <div class="panel panel-default mgl15 mgr15">
            <div class="panel-heading">创建九宫格活动</div>
            <div class="panel-body">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>一等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>一等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                                <span class="input-group-addon">如果是100%中奖,请把一等奖的奖品数量[ 1000就代表前1000人都中奖 ]填写多点</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>一等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
											<a href="javascript:void(0);" class="upload">上传</a>
                                            <input type="file" class="uploadFile" id="first" onchange="upload('first')">
											<a href="javascript:void(0);" onclick="view(this)">预览</a>
											请上传方形图片。
										</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">二等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">二等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">二等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
											<a href="javascript:void(0);" class="upload">上传</a>
                                            <input type="file" class="uploadFile" id="second"
                                                   onchange="upload('second')">
											<a href="javascript:void(0);" onclick="view(this)">预览</a>
											请上传方形图片。
										</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">三等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">三等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">三等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
											<a href="javascript:void(0);" class="upload">上传</a>
                                    <input type="file" class="uploadFile" id="third" onchange="upload('third')">
											<a href="javascript:void(0);" onclick="view(this)">预览</a>
											请上传方形图片。
										</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">四等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">四等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">四等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
											<a href="javascript:void(0);" class="upload">上传</a>
                                    <input type="file" class="uploadFile" id="four" onchange="upload('four')">
											<a href="javascript:void(0);" onclick="view(this)">预览</a>
											请上传方形图片。
										</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">五等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">五等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">五等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
											<a href="javascript:void(0);" class="upload">上传</a>
                                    <input type="file" class="uploadFile" id="five" onchange="upload('five')">
											<a href="javascript:void(0);" onclick="view(this)">预览</a>
											请上传方形图片。
										</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">六等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">六等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">六等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
                                    <a href="javascript:void(0);" class="upload" onclick="">上传</a>
                                    <input type="file" class="uploadFile" id="six" onchange="upload('six')">
                                    <a href="javascript:void(0);" onclick="view(this)">预览</a>
                                    请上传方形图片。
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">七等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">七等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">七等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
                                    <a href="javascript:void(0);" class="upload">上传</a>
                                    <input type="file" class="uploadFile" id="seven" onchange="upload('seven')">
                                    <a href="javascript:void(0);" onclick="view(this)">预览</a>
                                    请上传方形图片。
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">八等奖奖品设置：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">八等奖奖品数量：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">八等奖奖品图片：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">
                                    <a href="javascript:void(0);" class="upload">上传</a>
                                    <input type="file" class="uploadFile" id="eight" onchange="upload('eight')">
                                    <a href="javascript:void(0);" onclick="view(this)">预览</a>
                                    请上传方形图片。
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>预计活动的人数：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" value="0" step="1" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>每人最多允许抽奖次数：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" value="0" step="1" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i
                                class="glyphicon glyphicon-asterisk"></i>每天最多抽奖次数：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="number" value="0" step="1" class="form-control ipt250">
                                <span class="input-group-addon">请不要多于50字!</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">活动时间：</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input type="text" class="form-control ipt250">
                                <span class="input-group-addon">至</span>
                                <input type="text" class="form-control ipt250">
                            </div>
                        </div>
                    </div>
                    <div class="text-center">
                        <button type="button" class="btn btn-success">保存</button>
                    </div>
                </form>
            </div>
            {include file='public/footer'/}
        </div>
    </div>
</section>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="viewWrap">
                <div class="aui_titleBar">
                    <div class="aui_title" style="cursor: move;">预览图片</div>
                </div>
                <div class="aui_main" style="width: auto; height: auto;background: #fff;">
                    <div class="aui_content" style="padding: 20px 25px;width: 582px; text-align: center;">
                        <img id="viewimg" src="http://wx.yiszh.com/uploads/g/gpbsxr1432292261/3/4/b/0/thumb_5a62ae51efffb.png"
                             style="max-width: 100%;max-height: 100%;">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC_URL__/static/layer/layer.js"></script>
<script>

    function view(id){
        var src = $(id).attr("src");
        if(src){
            $("#viewimg").attr('src',src);
            $("#myModal").modal('show');
        }else{
            layer.alert("请上传该图片",{icon:7});
        }
    }
    function upload(file) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other', file);
        $.ajax({
            url: "{:url('uploads/upload')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            if (res.code == '0') {
                $("#" + file).parents('.input-group').find(".form-control").val(res.pic);
                $("#" + file).next('a').attr("src", res.pic)
            }
        }).fail(function (res) {
            alert("上传失败")
        });
    }

</script>
</body>

</html>